extends BoarStatusBase

var walk_time:float = 0
var turn_time:float = 0.0

func start():
	actor.play_animation("Walk")
	walk_time = 0
	turn_time = 0
	
func run_physics_process(delta)->void:
	actor.move_and_slide()
	turn_time += delta
	if find_player():
		return change_status("Run")
		
	if not find_floor():
		return change_status("Idle")
	elif find_wall():
		if turn_time > randi_range(0,3):
			turn_time = 0
			turn_direction()

	if walk_time > randi_range(2,8):
		return change_status("Idle")
		
	walk_time += delta
	
func run_process(delta)->void:
	common_velocity(delta,1.0)
